﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PartyArticleManageEdit.aspx.cs" Inherits="ZHDJ.BranchCenter.Module.Article.PartyArticleManageEdit" %>

<!DOCTYPE html>
<html>
<head runat="server">
    <title></title>
    <script src="../../../../Resource/ueditor/ueditor.config.js"></script>
    <script src="../../../../Resource/ueditor/ueditor.all.min.js"></script>
</head>
<body>
    <form id="form1" runat="server" style="background-color: #0000FF" onsubmit="return UESync();">
        <f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
        <f:Panel ID="Panel1" ShowBorder="false" ShowHeader="false" AutoScroll="true" runat="server">
            <Items>
                <f:SimpleForm ID="SimpleForm1" ShowBorder="false" ShowHeader="false" runat="server"
                    BodyPadding="10px" Title="SimpleForm">
                    <Items>
                        <f:TextBox ID="txtTitle" runat="server" Label="文章标题" LabelAlign="right" Required="true" ShowRedStar="true" RequiredMessage="请填写文章标题">
                        </f:TextBox>
                        <f:TextBox ID="txtSubhead" runat="server" Label="文章副标题" LabelAlign="right">
                        </f:TextBox>
                        <f:TextBox ID="txtAuthor" runat="server" Label="作者" LabelAlign="right" Required="true" ShowRedStar="true" RequiredMessage="请填写作者">
                        </f:TextBox>
                        <f:TextBox ID="txtAuthorUrl" runat="server" Label="作者原链接" LabelAlign="right">
                        </f:TextBox>
                        <f:DropDownList ID="ddlCategory" runat="server" Label="文章类型" LabelAlign="right">
                        </f:DropDownList>
                        <f:RadioButtonList ID="rblFlags" runat="server" Label="置顶格式" Width="430px" LabelAlign="right">
                        </f:RadioButtonList>
                        <f:TextBox ID="txtArticlesLable" runat="server" Label="文章标签" LabelAlign="right">
                        </f:TextBox>
                        <f:TriggerBoxPicker runat="server" ID="ppBranch" Required="true" EnableEdit="false" LabelAlign="right" ShowRedStar="true" Label="所属组织" WindinsTitle="选择组织" WindinsHeight="450px" WindinsWidth="700px" WindinsUrl="../../../Share/Picker/BranchSinglePicker.aspx" Trigger1Icon="None">
                        </f:TriggerBoxPicker>
                        <f:TextArea ID="txtSummary" Label="文章简介" runat="server" LabelAlign="right">
                        </f:TextArea>
                        <f:FileUpload runat="server" LabelAlign="right" EmptyText="请选择一张图片" ID="filePhoto"
                            Label="上传图片" ButtonText="图片" ButtonIcon="ImageAdd" AutoPostBack="true" OnFileSelected="filePhoto_FileSelected" AcceptFileTypes="image/*">
                        </f:FileUpload>
                        <f:HyperLinkImagePreview runat="server" ID="HyperLink1" CssStyle="cursor:pointer"
                            ShowEmptyLabel="true" LabelAlign="right" Text="查看图片" LabelWidth="80px">
                        </f:HyperLinkImagePreview>
                        <f:Label ID="lbContent" runat="server" LabelAlign="right" Text="文章内容："></f:Label>
                        <f:ContentPanel ID="ContentPanel1" runat="server" ShowBorder="false" ShowHeader="false">
                            <script type="text/plain" id="editor"></script>
                        </f:ContentPanel>
                        <f:HiddenField ID="hdImageId" runat="server"></f:HiddenField>
                    </Items>
                </f:SimpleForm>
            </Items>
            <Toolbars>
                <f:Toolbar ID="Toolbar1" runat="server" Position="Bottom" ToolbarAlign="Center">
                    <Items>
                        <f:Button ID="btnSaveClose" ValidateForms="SimpleForm1" Icon="SystemSaveClose"
                            OnClick="btnSaveClose_Click" runat="server" Text="保存并关闭">
                        </f:Button>
                        <f:ToolbarSeparator ID="ToolbarSeparator2" runat="server">
                        </f:ToolbarSeparator>
                        <f:Button ID="btnClose" Icon="SystemClose" EnablePostBack="false" runat="server"
                            Text="关闭" DisableControlBeforePostBack="True">
                        </f:Button>
                    </Items>
                </f:Toolbar>
            </Toolbars>
        </f:Panel>
    </form>
</body>
</html>
<script>
    var editorContent = '<%=EditorContent%>';

    var ue = UE.getEditor("editor", {
        initialFrameWidth: '100%',
        initialFrameHeight: '400px',
        enableAutoSave: false,
        saveInterval: 1000000,
        elementPathEnabled: false,
        autoHeightEnabled: false
    });

    ue.ready(function () {
        if (editorContent) {
            ue.setContent(editorContent);
        }
    });

    function UESync() {
        var editor = UE.getEditor('editor')
        editor.sync();
        return true;
    }
</script>
